/*ch例4-6*/
#include <stdio.h>
int level(int score, int n) //定义函数
{
    scanf("%d", &score);
    {
        n = score / 10; //除以10得到10位数字
        switch (n)
        {
        case 10:
            printf("A\n");
            break;
        case 9:
            printf("A\n");
            break;
        case 8:
            printf("B\n");
            break;
        case 7:
            printf("C\n");
            break;
        case 6:
            printf("D\n");
            break;
        default:
            printf("E\n");
            break;
        }
    }
}
int main()
{
    int score, n;
    printf("please input a grade:");
    level(score, n); //调用函数
    return 0;
}